#ifndef VIDEOSELECTWIDGET_H
#define VIDEOSELECTWIDGET_H

#include <QWidget>
#include<QLabel>
#include<QPushButton>
#include<QStackedLayout>
#include<QListWidget>
#include<QHBoxLayout>
#include<QCalendarWidget>
#include"contrl/mycontrol.h"
#include<QDialog>
#include<QVBoxLayout>
//#include"view/loginwidget.h"
#include"view/videoreolaywidget.h"
#include"golob.h"
#include<QMessageBox>
#include<QShowEvent>
class VideoSelectWidget : public QWidget
{
    Q_OBJECT
public:
    explicit VideoSelectWidget(QWidget *parent = nullptr);

    void initUI();

    void loadPage(int page);


    void SelectDataBase();

    void showEvent(QShowEvent *event);
signals:



    void SelectToMain();
public slots:
    void showCalender();
    void selectCalender(const QDate &date);

    void onNextPageClicked(); // 下一页按钮
    void onPrePageClicked();  // 上一页按钮

    void onEnsureClicked();//确定

    void ReolayToSelect();

    void onRetClicked();



private:
    QLabel*title;
    QLabel*text;
    QPushButton*date_button;
    QCalendarWidget *calendarWidget;
    QStackedLayout*stackedLayout;
    QListWidget*listWidget;
    QPushButton*prePage;
    QPushButton*nextPage;
    QPushButton*ensure;
    QPushButton*cancel;

    QHBoxLayout*layout_H1;
    QHBoxLayout*layout_H2;
    QHBoxLayout*layout_H3;
    QHBoxLayout*layout_H4;
    QHBoxLayout*layout_H5;

    QVBoxLayout*layout_V;


    QList<Video*> videos;
    QList<Video*> selectvideos;

    MyControl *con;
    BaseModel* model;


    VideoReolayWidget*reolay;

    int currentPage;//当前页
    int itemsPerPage;//每页显示的项数



};

#endif // VIDEOSELECTWIDGET_H
